﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Configuration.Json;
using System;
using System.IO;
using Microsoft.CodeAnalysis.Host;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {

            //设置config文件
            //var config = new ConfigurationBuilder()
            //                    .SetBasePath(Directory.GetCurrentDirectory())
            //                    .AddJsonFile("appSettings.json", optional: true, reloadOnChange: true).Build();

            ////设置依赖注入
            //var provider = new ServiceCollection()
            //                        .AddLogging(configLogging => //设置日志组件
            //                        {
            //                            configLogging.SetMinimumLevel(LogLevel.Information);
            //                            configLogging.AddConsole();
            //                        })
            //                       .AddScoped<IConfiguration>(p => config)
            //                       .AddScoped<HostServices>()
            //                       .BuildServiceProvider();

            //var hostService = provider.GetService<HostService>();

            //hostService.RunAsync();//统一入口服务

            //Console.WriteLine("提示：程序已正常启动运行，按任意键停止运行并关闭程序...");

            Console.ReadLine();

        }
    }
}
